function new_worklog(date){
	var get_date = parseInt(date.getTime()/1000);

	var url = PROJECT_PATH+'worklog/index/'+get_date;
	$.post(url+'/true',function(r,status){
		if(r.success){
			title = '修改';
		}else{
			title = '添加';
		}
		$('#dialog_custom_box').dialog({
			title: '为 '+date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+'日 '+title+'工作日志',
			width: 600,
			height: 480,
			iconCls:'icon-edit',
			closed: false,
			cache: false,
			href: url,
			method:'post',
			modal: true,
			buttons:[{
				text:title,
				iconCls:'icon-ok',
				handler:function(){
					$('#worklog_new_v').form('submit',{
						url:url,
						onSubmit:function(){
							return $(this).form('enableValidation').form('validate');
						},
						success: function(data){
							var data = eval('(' + data + ')');  // change the JSON string to javascript object
							if (data.success){
								$.messager.alert('成功',title+'成功');
								$('#worklog_list').datagrid('reload');	
								$('#dialog_custom_box').dialog('close');
							}else{
								$.messager.alert('警告',data.errorMsg);
							}
						}
					});
				}
			},{
				text:'取消',
				iconCls:'icon-cancel',
				handler:function(){
					$('#dialog_custom_box').dialog('close');
				}
			}],
			onLoadSuccess:function(node, data){
				alert('ok');
			}
		});
	},'JSON');
}
